import axios from "axios";
import { reactive } from "vue";

/**
 * @use 获取狗狗图片
 */
export const useDog = () => {
  const dogs = reactive([]);

  const addDogs = async () => {
    try {
      axios
        .get("https://dog.ceo/api/breed/pembroke/images/random")
        .then((res) => {
          // console.log(res.data.message);
          dogs.push(res.data.message);
        });
    } catch (error) {}
  };

  return { dogs, addDogs };
};
